home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 64
/
Volume 64 - JOGO DISK .iso
/
Games
/
the_best_every_day.swf
/
scripts
/
__Packages
/
MainCTRL.as
< prev
next >
Wrap
Text File
|
2008-04-10
|
3KB
|
139 lines
class MainCTRL
{
function MainCTRL(p_mcRef)
{
this.mcRef = p_mcRef;
this.bInGame = false;
this.bMenuOpen = false;
this.bPaused = false;
this.nLevel = 1;
this.nFunds = 5000;
this.nScore = 0;
_global.Pack = this;
this.bBonus = false;
}
function TitleCard()
{
this.nScore = 0;
this.mcRef.stop();
}
function AdjustScore(p_Num)
{
this.nScore += p_Num;
}
function Play()
{
if(this.bInGame)
{
this.mcRef.instructions.gotoAndStop(1);
this.hidesMenu();
this.bMenuOpen = false;
this.unPauseGame();
}
else
{
_global.Transition.play();
_global.Transition.TransFunc = function()
{
_global.Pack.nScore = 0;
_global.Pack.mcRef.instructions.gotoAndStop(1);
_global.Pack.mcRef.gotoAndStop("Game");
_global.Pack.bInGame = true;
};
}
}
function pauseGame()
{
_global.C.oGame.oLevel.Paused();
_global.C.oGame.oLevel.oCam.pause();
_global.C.oGame.oLevel.update();
_global.C.oGame.oLevel.oPatrick.sDropPoint.mcItem.stop();
this.bPaused = true;
}
function unPauseGame()
{
if(_global.GS.mcGame.FinishScreen._currentframe <= 1)
{
_global.C.oGame.oLevel.unPaused();
_global.C.oGame.oLevel.oCam.unpause();
if(_global.C.oGame.oLevel.oPatrick.sDropPoint.mcItem._currentframe != _global.C.oGame.oLevel.oPatrick.sDropPoint.mcItem._totalframes)
{
_global.C.oGame.oLevel.oPatrick.sDropPoint.mcItem.play();
}
_global.C.oGame.oLevel.oPatrick.mc._parent._parent.mcSpongebob.gotoAndStop("Idle");
this.bPaused = false;
}
}
function Instruc()
{
this.mcRef.instructions.gotoAndStop(2);
}
function showsMenu()
{
this.mcRef.mcGame.mcMenu.gotoAndPlay("appear");
this.bMenuOpen = true;
}
function hidesMenu()
{
this.mcRef.mcGame.mcMenu.gotoAndPlay("disapear");
this.bMenuOpen = false;
}
function pressMenu()
{
if(this.bMenuOpen)
{
this.hidesMenu();
this.unPauseGame();
}
else
{
this.showsMenu();
this.pauseGame();
}
}
function Quit()
{
_global.MiniGame.ClearControls();
_global.C.oGame.oLevel.oPatrick.ClearControls();
this.mcRef.gotoAndStop("EndCard");
this.bMenuOpen = false;
this.bInGame = false;
}
function EndCard()
{
_global.Sounds.SwitchToPack();
this.bMenuOpen = false;
this.bPaused = false;
if(this.nLevel >= 6)
{
this.mcRef.gotoAndStop("WinCard");
}
this.nLevel = 1;
if(!_global.Pack.bBonus)
{
this.nFunds = 5000;
}
else
{
this.nFunds = 6000;
}
}
function Code()
{
this.oSecretCodeInterface = new SecretCodeInterface(this.mcRef.mcCode);
this.oSecretCodeInterface.show();
this.mcRef.mcCode.onEnterFrame = function()
{
_global.Pack.oSecretCodeInterface.update();
};
}
function unlockCode(__Code)
{
if(__Code == "sBONUS")
{
_global.Pack.bBonus = true;
this.nFunds = 6000;
}
}
}